import React, { useContext } from 'react';

const defaultTheme = {
  primaryColor: 'white',
  primaryBgColor: 'black',
};

const ThemeContext = React.createContext(defaultTheme);

function Child() {
  const theme = useContext(ThemeContext);
  return <>{JSON.stringify(theme, null, 2)}</>;
}

export default function UseContext() {
  return (
    <ThemeContext.Provider value={defaultTheme}>
      <Child />
    </ThemeContext.Provider>
  )
}
